"""
@Author : 合肥一元数智教育科技有限公司
@Date :  2025/3/21 10:54
@Description : 
  修改
"""
import pymysql

conn = pymysql.connect(
    host='localhost',
    port=3306,
    user='root',
    passwd='root',
    db='python2511',
    charset='utf8'
)

cur = conn.cursor()
# 设置事务的自动提交
conn.autocommit(True)
# 编写sql
str_sql = "update user set username ='super',password='666666' where id = 3"
line = cur.execute(str_sql)
print(line)

# 释放资源
cur.close()
conn.close()